import { ToolTipItem } from "../../../../../com/mui/manager/ToolTipItem";
import { LoaderHelp } from "../../../../common/display/LoaderHelp";
import { ResFileConst } from "../../../resource/ResFileConst";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { WuXingConfig } from "../../../resource/WuXingConfig";
import { Language } from "../../../../../extend/language/Language";
type int = number;
//class WuXingDiceMaxItem
    
    export  class WuXingDiceMaxItem extends ToolTipItem
    {
        constructor()
        {
            super();
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            this._bitmap = new Object /* flash.display.Bitmap */();
            this.addChild(this._bitmap);
            this.toolTipData = this.getTipData();
            return;
        }

        public set maxNum(arg1: int)
        {
            this._maxNum = arg1;
            if (arg1 >= 0 && arg1 < 5) 
            {
                this._showNum = 3;
            }
            else if (arg1 >= 5 && arg1 < 7) 
            {
                this._showNum = 5;
            }
            else if (arg1 >= 7 && arg1 < 10) 
            {
                this._showNum = 7;
            }
            else 
            {
                this._showNum = 10;
            }
            LoaderHelp.addResCallBack(ResFileConst.wuxing, this.onWuXingLodedHandler);
            return;
        }

        /* internal  */onWuXingLodedHandler(): void
        {
            this._bitmap.bitmapData = GlobalClass.getBitmapData("WuXingMaxDice" + this._showNum);
            return;
        }

        /* internal  */getTipData(): string
        {
            var loc1=null;
            var loc2=0;
            var loc3=0;
            var loc4=0;
            if (!this._tipData) 
            {
                this._tipData = "";
                loc1 = [3, 5, 7, 10];
                loc4 = 0;
                while (loc4 < loc1.length) 
                {
                    loc2 = loc1[loc4] as int;
                    loc3 = WuXingConfig.instance.getWuxingEnergyEtc(loc2);
                    this._tipData = this._tipData + Language.getStringByParam(26216, loc2, loc3);
                    if (loc4 != (loc1.length - 1)) 
                    {
                        this._tipData = this._tipData + "\n\n";
                    }
                    this._tipData = "<textFormat leading=\'5\'><font color=\'#ffffff\'>" + this._tipData + "</font></textFormat>";
                    ++loc4;
                }
            }
            return this._tipData;
        }

        /* internal */ /* var */_bitmap: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_maxNum: int;

        /* internal */ /* var */_showNum: int;

        /* internal */ /* var */_tipData: string;
    }
